﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace cludg.Web.Core.ViewModels
{
	public abstract class MenuBase
	{
		private readonly List<MenuItem> _items = new List<MenuItem>();
		public List<MenuItem> Items { get { return _items; } }
	}

	public class MenuItem : MenuBase
	{
		public string Id { get; set; }
		public string Caption { get; set; }
		public string Url { get; set; }
		public bool Selected { get; set; }
	}

	public class Menu : MenuBase
	{
		public void SetActiveItem(string itemId)
		{
			foreach (var item in Items)
			{
				item.Selected = item.Id == itemId;
			}
		}
	}
}
